<?php
// +----------------------------------------------------------------------
// | 文件搬迁，现用于导览语音保存服务器
// +----------------------------------------------------------------------
// | Author: TongBC <50249101@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/04/23
// +----------------------------------------------------------------------
include_once("/var/www/html/new/com.inc.php");
// http://webapi.openspeech.cn/ctts1PPHaBH-kPIVaVondjsHYtznuAIdBrdEG.mp3
$arr['url'] = $_POST['url'];
// $arr['url'] = 'http://webapi.openspeech.cn/ctts1PPHHBH-nqwrw9ZoO0dc0Irubl0SNHN7.mp3';
$arr['account'] = $_SESSION['saccount'];
$arr['token'] = '47acf21094917341ade75bee5990eb02';
$result = file_get_curl($arr,'http://s.12301.cc/pft/tour/audio.php');
$ra = json_decode($result, 'true');
if($ra) exit($result);

exit('{"status":"failure","msg":"文件请求失败"}');
// 使用 curl 发送远端请求
function file_get_curl($data,$url){
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_POST, 1); 
	curl_setopt($ch, CURLOPT_HEADER, 0); 
	curl_setopt($ch, CURLOPT_URL,$url);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	$result = curl_exec($ch);
	curl_close($ch);
	return $result;
}

?>